from tkinter import *
print('Введите начальную координату X:')
X = int(input())
print('Введите начальную координату Y:')
Y = int(input())
print('Введите коэффициент увеличения N:')
N = int(input())
coords = [10*N+X,10*N+Y,20*N+X,10*N+Y,20*N+X,20*N+Y,30*N+X,20*N+Y,30*N+X,40*N+Y,20*N+X,40*N+Y,20*N+X,30*N+Y,10*N+X,30*N+Y]
if N == 0 and X>=0 and X<=500 and Y>=0 and Y<=500:
     pass
else:
     if N > 0 and 0*N+X>=0 and 0*N+Y>=0 and 20*N+X<=500 and 20*N+Y<=500:
         pass
     else:
         if N < 0 and 20*N+X>=0 and 20*N+Y>=0 and 0*N+X<=500 and 0*N+Y<=500:
             pass
         else:
              print('Размер фигуры превышает максимальный размер поля')
              exit()
root = Tk()
root.title("ИТ марафон")
root.geometry("500x500")
canvas = Canvas(bg="white", width=500, height=500)
canvas.pack(anchor=CENTER, expand=1)
canvas.create_polygon(coords)
